package dongshi.daddy.raft.logcopy.statemachine;

//
public class StateMachineTest {
    public static void main(String[] args) {
        Locker locker = new Locker("123456");
        System.out.println("--------------");
        // 使用正确的密码打开密码柜
        Action action = new Action();
        action.setCommand(Locker.COMMAND_OPEN);
        action.setPwd("123456");
        locker.action(action);
        System.out.println("--------------");
        // 关闭密码柜
        Action action1 = new Action();
        action1.setCommand(Locker.COMMAND_CLOSE);
        locker.action(action1);
        System.out.println("--------------");
        // 使用错误的密码打开密码柜
        Action action2 = new Action();
        action2.setCommand(Locker.COMMAND_OPEN);
        action2.setPwd("1223456");
        locker.action(action2);
        System.out.println("--------------");
    }
}
